//
//  Common.swift
//  sui04mac
//
//  Created by 杨剑 on 2023/11/24.
//

import Foundation

func generateID() -> Int{
    Int(Date.timeIntervalSinceReferenceDate * 10)
}

func fetchCluster(cluster_id : String) -> ClusterModel {
    return [
        ClusterModel(cluster_id: "ebs",name: "国内1区",base_url: "https://a1.easemob.com"),
        ClusterModel(cluster_id: "hw",name: "国内2区",base_url: "https://a31.easemob.com"),
        ClusterModel(cluster_id: "sgp",name: "新加坡1区(aliyun)",base_url: "http://a1-sgp.easemob.com"),
        ClusterModel(cluster_id: "singapore",name: "新加坡2区(aws)",base_url: "https://a61.easemob.com"),
        ClusterModel(cluster_id: "east",name: "美东",base_url: "https://a41.easemob.com"),
        ClusterModel(cluster_id: "frankfurt",name: "法兰克福(旧)",base_url: "https://a51.easemob.com"),
        ClusterModel(cluster_id: "fra",name: "法兰克福(新)",base_url: "https://a71.easemob.com"),
        ClusterModel(cluster_id: "vip5",name: "VIP-5",base_url: "https://a1-vip5.easemob.com"),
        ClusterModel(cluster_id: "vip6",name: "VIP-6",base_url: "https://a1-vip6.easemob.com"),
    ].first { model in
        model.cluster_id == cluster_id
    } ?? ClusterModel(cluster_id: "error",name: "⚠️错误",base_url: "https://www.easemob.com")
    
}











